/**
 * @file rotary_button.h
 * @author taylor peng
 * @brief 旋转按键编码器
 * @version 0.1
 * @date 2022-01-23
 * 
 * @copyright Copyright (c) 2022
 * 
 */
#ifndef _ROTARY_BUTTON_H_
#define _ROTARY_BUTTON_H_

#include "OneButton.h"

#define ROTARY_TYPE 2

#define ROTARY_PIN1      27
#define ROTARY_PIN2      14
#define BUTTON_PIN      33

extern unsigned char SYSKey;
extern bool Counter_LOCK_Flag;

void sys_RotaryInit(void);
void sys_Counter_Set(double min, double max, double step, double c);
void sys_Counter_SetVal(double c);
void RotaryUp(void);
void RotaryDown(void);

void sys_Counter_click(void);
void sys_Counter_doubleclick(void);
void sys_Counter_longclick(void);
void sys_Counter_IRQHandler(void);
double sys_Counter_Get(void);
unsigned char sys_Counter_Change(void);

void Clear_RButton_FIFO(void);
unsigned char sys_KeyProcess(void);
void System_UI_Init(void);

#endif /* _ROTARY_BUTTON_H_ */
